<?PHP

	// =======================================================================================
	// = WARNING: Changing HTML classes and ids will probably break JavaScript functionality =
	// =======================================================================================

if(count($content) > 0){
	
?>
<div id="op_feature_carousel_features-<?PHP echo $this->values['number'] ?>" class="op_feature_carousel_features">
	<ul class="features">
<?PHP
	for($i=0; $i < count($content); $i++) {
		$feature_class = $i+1; // i.e. feature-1


// Output until EOS;
echo <<<EOS
<li class="feature-{$feature_class}">
	<div class="image_wrap"><span class="image"><a href="{$content[$i]['link']}"><img src="{$content[$i]['image']}" alt="{$content[$i]['title']}" /></a></span></div>
	<h2 title="{$content[$i]['title']}"><a href="{$content[$i]['link']}">{$content[$i]['title']}</a></h2>
	<div class="p_wrap"><p>{$content[$i]['excerpt']}</p></div>
EOS;
	do_action('op_feature_carousel_widget',array('id'=>$this->values['number'],'post'=>$content[$i]['all']));
echo <<<EOS
</li>			
EOS;
// ATTN -- do not move line above this: "EOS;"
	}

?>
		</ul>
	</div>
<div id="op_feature_carousel_links-<?PHP echo $this->values['number'] ?>" class="op_feature_carousel_links">
	<div class="title"><?PHP echo $title ?></div>
		<ul>

<?PHP
for($j=0; $j < $i; $j++){
	$link_class = $j+1; // i.e. featurelink-1

$selected = $j == 0 ? ' selected' : '';
echo '<li class="featurelink-'.$link_class.$selected.'"><a href="#">';
if(has_action('op_feature_carousel_widget_nav')){
	do_action('op_feature_carousel_widget_nav',array('id'=>$this->values['number'],'class'=>$link_class));	
}
else{
	echo $link_class;	
}

echo '</a></li>';

}

?>

	</ul>
 <span style="display:none" id="featurecarousel_animate_<?PHP echo $this->values['number'] ?>"><?PHP echo $this->values['transition'] ?></span>
 <span class="forclear"></span>
</div>
     

<?PHP } ?>